#ifndef DCLASSENTITY_H
#define DCLASSENTITY_H

#include "dabstractentity.h"
#include "enums.h"

class DVariableEntity;
class DMethodEntity;

class DClassEntity : public DAbstractEntity
{
	Q_OBJECT
public:
	typedef QList<DVariableEntity*> Variables;
	typedef QList<DMethodEntity*> Methods;

	DClassEntity(ClassType eClassType, QObject *parent = 0);
	~DClassEntity();

	void				addVariable(DVariableEntity* pVar);
	void				addMethod(DMethodEntity* pMethod);

	const Variables&	variables() const;
	const Methods&		methods() const;

	DClassEntity*		baseClass() const;
	void				addSubclass(DClassEntity* pClass);
	void				removeSubclass(DClassEntity* pClass);
	const QList<DClassEntity*>& subclasses() const;

	ClassType			classType() const;
	int					level();

	QString				toString() const;
private:
	Variables			m_variables;
	Methods				m_methods;
	DClassEntity*		m_pBaseClass;
	QList<DClassEntity*> m_subclasses;
	ClassType			m_eClassType;

	// helper variables for graphics view
	int					m_nLevel;
};

Q_DECLARE_METATYPE(DClassEntity*);

#endif // DCLASSENTITY_H
